package com.mentalhealthplatform.utils.decryptUtils;

public class DecryptionException extends Exception {

    private String propertyName;  // 解密失败的属性名
    private String propertyValue; // 解密失败的属性原始值
    private String failureReason; // 解密失败的原因

    // 构造函数
    public DecryptionException(String propertyName, String propertyValue, String failureReason, Throwable cause) {
        super("Decryption failed for property: " + propertyName + ". Original value: " + propertyValue + ". Reason: " + failureReason, cause);
        this.propertyName = propertyName;
        this.propertyValue = propertyValue;
        this.failureReason = failureReason;
    }

    // 获取属性名
    public String getPropertyName() {
        return propertyName;
    }

    // 获取属性原始值
    public String getPropertyValue() {
        return propertyValue;
    }

    // 获取解密失败的原因
    public String getFailureReason() {
        return failureReason;
    }
}
